package com.msb.internalcommon.util;

/**
 * @Auther: jiudianliu
 * @Date: 2023/5/25 - 05 - 25 - 15:44
 * @Description: com.msb.internalcommon.util
 * @version: 1.0
 */
public class RedisPrefixUtils {

    //乘客验证码的前缀
    public static String verificationCodePrefix = "passenger-verification-code-";

    //token存储的前缀
    public static String tokenPrefix = "token-";

    // 黑名单设备号
    public static String blackDeviceCodePrefix = "black-device-";


    /**
     * 根据手机号 生成key
     * @param phone
     * @param identity
     * @return
     */
    public static String  generatorKeyByPhone(String phone , String identity){
        return verificationCodePrefix + identity + "-" + phone ;
    }

    /**
     * 根据手机号和身份标识生成Token
     * @param phone
     * @param identity
     * @return
     */
    public static String generatorTokenKey(String phone , String identity , String tokenType){
        return tokenPrefix + phone + "-" + identity + "-" + tokenType ;
    }
}
